package org.kzwl.book.controller.app;


import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.kzwl.comm.advice.BizException;
import org.kzwl.comm.pojo.ResponseData;
import org.kzwl.comm.pojo.bo.AdminQueryNewsBO;
import org.kzwl.comm.pojo.bo.NewsBO;
import org.kzwl.comm.pojo.bo.news.NewsBasicBO;
import org.kzwl.comm.pojo.bo.news.QueryDetailsBO;
import org.kzwl.comm.pojo.dto.news.NewsDTO;
import org.kzwl.entity.web.News;
import org.kzwl.service.web.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@RequestMapping("/appNewsController")
@Api("App新闻业务")
public class AppNewsController {

    @Autowired
    NewsService newsService;

    @ApiOperation(value = "查询最新资讯", notes = "只填分页参数")
    @PostMapping("/queryNews")
    public ResponseData<List<NewsDTO>> queryNews(@RequestBody NewsBasicBO newsBO) {
        List<NewsDTO> list = newsService.queryNews(newsBO);
        return new ResponseData<>(list);
    }

}
